<template>
	<div>
		<el-table :data="datalist" style="width: 100%">
			<el-table-column type="index" :index="(currentPage - 1) * limit + 1" label="序号" width="50" />
			
			<el-table-column prop="title" label="标题" show-overflow-tooltip></el-table-column>
			<el-table-column prop="date" label="日期" width="180"></el-table-column>
			<el-table-column prop="name" label="作者" width="180"></el-table-column>
			<el-table-column  label="操作" width="180">
				  <template slot-scope="scope">
					<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
					<el-button type="text" size="small" @click="handleClick(scope.row.title)">审核</el-button>
				</template>
			</el-table-column>
		</el-table>
		<!--弹出框-->
		<el-dialog  :visible.sync="dialogVisible" width="40%">
			<p style="font-size: 16px;color: red;text-align: left;" slot="title">{{aTitle}}</p>
			<el-form ref="formInfo" :model="formInfo" label-width="80px">
			  
			  <el-form-item label="审核状态">
			    <el-radio-group v-model="formInfo.rdState">
			      <el-radio label="1">审核通过</el-radio>
			      <el-radio label="0">审核不通过</el-radio>
			    </el-radio-group>
			  </el-form-item>
			  <el-form-item label="审核内容">
			    <el-input type="textarea" v-model="formInfo.content"></el-input>
			  </el-form-item>
			  <el-form-item>
			    <el-button type="primary" @click="onSubmit">提交</el-button>
			  
			  </el-form-item>
			</el-form>
			
		</el-dialog>
	</div>
</template>

<script>
export default {
	name: 'DataTable',
	props: {
		datalist: Array,
		currentPage: Number,
		limit: Number
	},
	data() {
		return {
			dialogVisible: false,
		    aTitle:'',
			formInfo:{
				rdState:'0',
				content:''
			}
			
		};
	},
	methods: {
		handleClick(title) {
			this.dialogVisible = true;
			this.aTitle=title;
			
		},
		handleClose(done) {
			this.$confirm('确认关闭？')
				.then(_ => {
					done();
				})
				.catch(_ => {});
		},
		onSubmit(){
			console.log("操作完成");
			console.log(this.formInfo);
			this.dialogVisible = false;
			
		}
	}
};
</script>

<style></style>
